import { forwardRef, Module } from '@nestjs/common';
import { MissionService } from './mission.service';
import { MissionController } from './mission.controller';
import { TypeOrmModule } from '@nestjs/typeorm';
import { MissionEntity } from './mission.entity';
import { MissionUserEntity } from './mission-user.entity';
import { TenantModule } from '../tenant/tenant.module';
import { MissionLogModule } from './mission-log/mission-log.module';
import { RouterModule } from '@nestjs/core';
import { PointsModule } from '../points/points.module';
import { CatalogModule } from '../catalog/catalog.module';

const modules = [MissionLogModule];

@Module({
  imports: [
    TenantModule,
		MissionLogModule,
		PointsModule,
    RouterModule.register([
      {
        path: 'cms/mission',
        module: MissionModule,
        children: [...modules],
      },
    ]),
    TypeOrmModule.forFeature([MissionEntity, MissionUserEntity]),
		forwardRef(() => CatalogModule)
  ],
  controllers: [MissionController],
  providers: [MissionService],
  exports: [MissionService, TypeOrmModule],
})
export class MissionModule {}
